package com.dxy.df.modules.controller;

import com.dxy.df.core.model.Rs;
import com.dxy.df.core.shiro.ShiroUtils;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author wangsheng@dxy.cn
 * @date 2019-10-25
 **/
@Api(tags = "用户登录")
@RestController
@RequestMapping("/api/users/login")
public class UserLoginController {

    @PostMapping("")
    public Rs login() {
        String userAccount = ShiroUtils.getUserAccount();
        if (null == userAccount) {
            userAccount = "";
        }
        return Rs.ok().putData("user_account", userAccount);
    }
}
